const express = require('express');
// 解决history刷新错误的问题
var history = require('connect-history-api-fallback');

const app = express();
// 使用history
app.use(history());

app.use(express.static(__dirname+'/public'))
app.get('/person', (req, res) => {
    res.send({
        name: '张三',
        age: 18
    })
})

app.listen(5005, "192.168.1.100", (error) => {
    if(!error) {
        console.log('服务器启动成功')
    }
})